package cn.ruihusoft.ql.client;

import cn.ruihusoft.ql.pojo.Response;
import cn.ruihusoft.ql.pojo.script.AddScriptRequest;
import cn.ruihusoft.ql.pojo.script.DeleteScriptRequest;
import cn.ruihusoft.ql.pojo.script.DownloadScriptRequest;
import cn.ruihusoft.ql.pojo.script.ScriptResponse;
import cn.ruihusoft.ql.pojo.script.UpdateScriptRequest;
import com.dtflys.forest.annotation.Delete;
import com.dtflys.forest.annotation.Get;
import com.dtflys.forest.annotation.JSONBody;
import com.dtflys.forest.annotation.Post;
import com.dtflys.forest.annotation.Put;
import com.dtflys.forest.annotation.Query;
import com.dtflys.forest.annotation.Var;

public interface ScriptClient extends BaseAuthClient {

    @Get("/scripts/files")
    Response<ScriptResponse> allScript();

    @Get("/scripts/{filepath}")
    Response<ScriptResponse> script(@Var("filepath") String filepath, @Query("file") Integer fileId);

    @Post("/scripts")
    Response<String> addScript(@JSONBody AddScriptRequest request);

    @Put("/scripts")
    Response<String> updateScript(@JSONBody UpdateScriptRequest request);

    @Delete("/scripts")
    Response<String> deleteScript(@JSONBody DeleteScriptRequest request);

    @Post("/scripts/download")
    Response<String> downloadScript(@JSONBody DownloadScriptRequest request);

    @Put("/scripts/run")
    Response<String> runScript(@JSONBody DeleteScriptRequest request );

    @Put("/scripts/stop")
    Response<String> stopScript(@JSONBody DeleteScriptRequest request);

}
